#include "MallocShare.h"

MallocShare& MallocShare::Get()
{
	static MallocShare mallocChest;
	return mallocChest;
}

void* MallocShare::Malloc(uint32 count, uint32 alignment /*= DEFAULT_ALIGNMENT*/)
{
	std::lock_guard<std::mutex> lk(mThreadsCritical);
	return MallocChest::Malloc(count, alignment);
}

void* MallocShare::Realloc(void* original, uint32 count, uint32 alignment /*= DEFAULT_ALIGNMENT*/)
{
	std::lock_guard<std::mutex> lk(mThreadsCritical);
	return MallocChest::Realloc(original, count, alignment);
}

void MallocShare::Free(void* original)
{
	std::lock_guard<std::mutex> lk(mThreadsCritical);
	MallocChest::Free(original);
}
